<?php
/*
 * akimimi front
 * Update Campus Ambassador Address
 * 
 * author steve
 */

require_once '../app/views/BaseView.php';

class UpdateAddressView extends BaseView {
	public function getPage($userInfo){
		$this->setPageTitle(constant("MODIFYREGISTERINFO"));
		$this->addJS('frontend.js',true);
		$this->addCSS('myaccountleftnav.css');
		$this->addCSS('myaccount.css');
		$header = '';
		$str_result = $header
                    . $this->getContent($userInfo);
        return $this->getHtmlPage($str_result);
	}
	
	public function getContent($userInfo){
	    $str_hidden = '<input type="hidden" id="errorTeamNameEmpty" value="'.TEAMNAMEEMPTY.'" /><input type="hidden" id="errorFullNameEmpty" value="'.FULLNAMEEMPTY.'" />';
	    $str_hidden .= '<input type="hidden" id="errorProvinceEmpty" value="'.PROVINCEEMPTY.'" /><input type="hidden" id="errorCityEmpty" value="'.CITYEMPTY.'" />';
	    $str_hidden .= '<input type="hidden" id="errorAddressEmpty" value="'.RECEIVEADDRESSEMPTY.'" /><input type="hidden" id="errorZipCodeEmpty" value="'.ZIPCODEEMPTY.'" />';
	    $str_hidden .= '<input type="hidden" id="errorMobileEmpty" value="'.MOBILENUMEMPTY.'" /><input type="hidden" id="errorMobileError" value="'.MOBILEERROR.'" />';
	    $str_hidden .= '<input type="hidden" id="updateConfirm" value="'.UPDATECONFIRM.'" />';
	    
	    $str_result = '<div id="navigation"><a href="/">'.WEBSITEINDEXPAGETXT.'</a><span>></span><a href="/userinfo/index">'.MYAKIMIMITXT.'</a><span>></span><a href="/userinfo/updateaddress">'.MODIFYREGISTERINFO.'</a></div>';
	    $str_result .= $str_hidden;
	    $str_result .= '<div id="mymimi_body">'.MyAccountLeftNav::getMyAccountLeftNav();
	    $str_result .= '<div id="mymimi_right"><div class="right_bj"></div>';
	    $str_result .= '<div style="color:#949494; font-size:15px; font-weight:bold; margin:6px;">'.UPDATEADDRESSINFOLEFT.'<font color="#FF0000"><b>'.$_SESSION['username'].'</b></font>'.UPDATEADDRESSINFORIGHT.'</div>';
	    
	    $str_result .= '<div class="add_border" >';
	    $str_result .= '<form action="/o/updateaddress" method="post" id="updateAddressForm" onsubmit="javascript:return UpdateAddress.updateSubmit();">';
	    $str_result .= '<div class="add_row_1" style="margin-top:10px;"><ul>';
	    $str_result .= '<li class="style_1">'.TEAMNAME.'</li><li class="style_2"><input type="text" name="teamName" class="input_delivery" id="teamName"  value="'.$userInfo[0]['team_name'].'" onblur="javascript:UpdateAddress.validateTeamName();"/></li>';
        $str_result .= '<li class="style_star">*</li><li><span id="errorTeamName" class="error_font_color" ></span></li>';
	    $str_result .= '</ul></div>';
	    
	    $str_result .= '<div class="add_row_1" ><ul>';
	    $str_result .= '<li class="style_1">'.FULLNAME.'</li><li class="style_2"><input type="text" name="fullName" class="input_delivery" id="fullName"  value="'.$userInfo[0]['full_name'].'" onblur="javascript:UpdateAddress.validateFullName();"/></li>';
        $str_result .= '<li class="style_star">*</li><li><span id="errorFullName" class="error_font_color" ></span></li>';
	    $str_result .= '</ul></div>';
	    
	    $str_result .= '<div class="add_row_1" ><ul>';
	    $str_result .= '<li class="style_1">'.PROVINCE.'</li><li class="style_2"><input type="text" class="input_delivery" id="province" name="province" value="'.$userInfo[0]['district'].'" onblur="javascript:UpdateAddress.validateProvince();"/></li>';
        $str_result .= '<li class="style_star">*</li><li><span id="errorProvince" class="error_font_color" ></span></li>';
	    $str_result .= '</ul></div>';
	    
	    $str_result .= '<div class="add_row_1" ><ul>';
	    $str_result .= '<li class="style_1">'.CITY.'</li><li class="style_2"><input type="text"  class="input_delivery" id="city" name="city" value="'.$userInfo[0]['city'].'" onblur="javascript:UpdateAddress.validateCity();" /></li>';
        $str_result .= '<li class="style_star">*</li><li><span id="errorCity" class="error_font_color" ></span></li>';
	    $str_result .= '</ul></div>';
	    
	    $str_result .= '<div class="add_row_1"><ul><li class="style_1">'.RECEIVEADDRESS.'</li>';
        $str_result .= '<li class="style_addr"><textarea name="receiveAddr" class="text_style" rows="4" cols="300"  id="receiveAddr" onblur="javascript:UpdateAddress.validateAddress();" >'.$userInfo[0]['addr'].'</textarea></li>';
        $str_result .= '<li class="style_star" style="width:20px;">*</li><li><span id="errorReceiveAddr" class="error_font_color" ></span></li>';
        $str_result .= '</ul></div>';
        
        $str_result .= '<div class="add_row_1" ><ul>';
	    $str_result .= '<li class="style_1">'.ZIPCODE.'</li><li class="style_2"><input type="text"  class="input_delivery" id="zipCode" name="zipCode" value="'.$userInfo[0]['postal_code'].'" onblur="javascript:UpdateAddress.validateZipCode();" /></li>';
        $str_result .= '<li class="style_star">*</li><li><span id="errorZipCode" class="error_font_color" ></span></li>';
	    $str_result .= '</ul></div>';
	    
	    $str_result .= '<div class="add_row_1" ><ul>';
	    $str_result .= '<li class="style_1">'.MOBILENUM.'</li><li class="style_2"><input type="text"  class="input_delivery" id="mobile" name="mobile" value="'.$userInfo[0]['mobile'].'" onblur="javascript:Delivery.validateMobile();" /></li>';
        $str_result .= '<li class="style_star">*</li><li><span id="errorMobile" class="error_font_color" ></span></li>';
	    $str_result .= '</ul></div>';
	    
	    $str_result .= '<div class="add_row_1" ><ul>';
	    $str_result .= '<li class="style_1">'.FIXEDPHONENUM.'</li><li class="style_2"><input type="text"  class="input_delivery" id="fixedPhone" name="fixedPhone" value="'.$userInfo[0]['phone'].'"  /></li>';
        $str_result .= '<li class="style_star"></li><li><span id="errorMobile" class="error_font_color" ></span></li>';
	    $str_result .= '</ul></div>';
	    
	    $str_result .= '<div class="add_row_2">';
		$str_result .= '<div class="button1" style="cursor:pointer;" onclick="javascript:UpdateAddress.updateSubmit();">'.SUBMIT.'</div>';
        $str_result .= '</div>';
        $str_result .= '</form></div>';
        
        $str_result .= '</div></div>';
	    
	    return $str_result;
	}
}
